= form_for(@topic) do |f|
  = if @topic.errors.any?
    %div["error_explanation"]
      %h2
        = pluralize(@topic.errors.count, "error")
        prohibited this topic from being saved:
      %ul
        = @topic.errors.full_messages.each do |msg|
          %li= msg
  %span.field
    = f.label :title, 'Название'
    = f.text_field :title
  %span.field
    = f.label :public, 'Видят все'
    = f.check_box :public
  %span.field
    = f.label :guest_ok, 'Пишут все'
    = f.check_box :guest_ok
  %span.field
    = f.label :published, 'Опубликована'
    = f.check_box :published
  %div.actions
    = f.submit 'Создать тему'